#ifndef THREAD_HPP
#define THREAD_HPP

#include "NonCopyable.hpp"
#include <pthread.h>
#include <stdio.h>
#include <string.h>

class Thread
: public NonCopyable
{
public:
    Thread();
    virtual ~Thread();

    void start();   // 启动一个子线程
    void join();    // 等待一个子线程结束

private:
    static void *start_routine(void *arg);
    virtual void run() = 0;

private:
    pthread_t _pthread_id;  // 子进程ID
    bool _isRunning;    // 子进程是否在运行
};

#endif